//
// Created by YH31 on 2021/6/15.
//

#ifndef CRC_CRC_16_H
#define CRC_CRC_16_H
#include "stdint.h"
#include "stdio.h"
uint16_t gencrc16_IBM(uint8_t data);
void crc_16_generTable_IBM();
uint16_t crc16_IBM(unsigned char * datas,uint8_t len);
uint16_t crc16_MAXIM(unsigned char * datas,uint8_t len);


uint16_t crc16_USB(unsigned char * datas,uint8_t len);


uint16_t crc16_MODBUS(unsigned char * datas,uint8_t len);
uint16_t getcrc16_MODBUSstr(uint8_t *buffer, uint8_t len);


uint16_t gencrc16_CCITT(uint8_t data);
void crc_16_generTable_CCITT();
uint16_t crc16_CCITT(uint8_t* datas,uint8_t len);

uint16_t crc16_X25(uint8_t* datas,uint8_t len);

uint16_t gencrc16_XMODEM(uint8_t data);
uint16_t crc16_XMODEM_Str(uint8_t* datas, uint8_t len);
void crc_16_generTable_XMODEM();
uint16_t crc16_XMODEM (uint8_t* datas, uint8_t len);


uint16_t  crc16_CCITT_FALSE(uint8_t* datas,uint8_t len);
uint16_t getcrc16_CCITT_falseStr(uint8_t* datas,uint8_t len);




uint16_t gencrc16_DNP(uint8_t data);
void crc_16_generTable_DNP();
uint16_t crc16_DNP(uint8_t * datas,uint8_t len);

#endif //CRC_CRC_16_H
